/*
 * @Author: hongbin
 * @Date: 2022-09-22 19:41:35
 * @LastEditors: hongbin
 * @LastEditTime: 2022-09-22 19:43:15
 * @Description:初始化webGL 渲染器
 */

import * as THREE from "three";

/**
 * 初始化webGL 渲染器
 */
export const initWebGLRenderer = (parameters?: THREE.WebGLRendererParameters) => {
    const renderer = new THREE.WebGLRenderer(parameters);
    renderer.setPixelRatio(window.devicePixelRatio);
    renderer.setSize(window.innerWidth, window.innerHeight);
    renderer.shadowMap.enabled = true;
    renderer.outputEncoding = THREE.sRGBEncoding;
    window.renderer = renderer;
    return renderer;
};
